import logging, uuid
log = logging.getLogger(__name__)

def VMID2CertName(vmid):
    certname="vm_%012d_%s"%(vmid,str(uuid.uuid4()))
    return certname

def CertName2VMID(certname):
    vmid=int(certname.split("_")[1])
    return vmid

    
